
from Util import *;
from Multipliers import *;

#### Societal Traits ####

class Trait(Multipliers):
	def __init__(self):
		Multipliers.__init__(self);
		
		self.advantages = "";
		self.disadvantages = "";
		

#### Government

class TribalGovt(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Tribal";
		self.description = """\
As the strongest and wisest, you lead your tribe."""
		

class MilitaryGovt(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Military";
		self.description = """\
Your rule is enforced by brute force."""
		

class TheocraticGovt(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Theocratic";
		self.description = """\
You stand appointed by the Lord, as defender of the faith and spiritual ruler of your people."""

class RepresentativeGovt(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Representative";
		self.description = """\
You are elected to represent the views of your people. Elections will take place every four years,
so you must keep your people happy to guarantee reelection."""

class DemocraticGovt(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Democratic";
		self.description = """\
The advent of fast electronic communication has made it possible for cheap and
easy public consultation on every political matter, allowing the realisation of
true democracy. In this model, you stand as head of state, a figurehead with the
power to propose motions which will be granted upon a majority verdict in a public
referendum."""
		self.disadvantages = """\
Cannot make major political decisions without referendum (e.g. declaration of war,\
change of tax rates)."""


#### Economy

class BarterEconomy(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Barter";
		self.description = """\
In this model, there is no money. Goods are traded for goods of equal value, where
value is determined by the amount of labour in producing the goods.""";
		self.disadvantages = """\
Cannot raise Taxes.
Can only trade goods.
Cannot use any tax-consuming city improvement.""";

class FreeMarketEconomy(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Free Market";
		self.description = """\
The use of abstract representations of value ("money") makes trade a breeze, but requires
faith in that representation. Precious metals are often used, so you will collect taxes in
gold."""

class CentralizedEconomy(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Centralized";
		self.description = """\
This economy is based around legal tender issued by the central bank of your empire. This
reduces corruption, and allows you to set interest rates and print money."""
		self.advantages = """\
Can print money when in deficit
Can set interest rates""";

class StateOwnedEconomy(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "State Owned";
		self.description = """\
This economy is based around legal tender issued by the central bank of your empire. This
reduces corruption, and allows you to set interest rates and print money."""
		self.advantages = """\
Can print money when in deficit
Can set interest rates""";

class SealedEconomy(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Sealed";
		self.description = """\
The sealed economy is based upon a centralized and fixed digtital money supply. This
tight control over the money supply eliminates inflation and greatly reduces corruption,
but means that banks can no longer operate. It also means that foriegn currency must be
traded as a commodity, so you cannot import more goods than you export."""
		self.advantages = """\
Eliminates inflation.
Corruption reduced by 60%.""";
		self.disadvantages = """\
Cancels effect of Banks.
Cannot import more goods than exported."""



class TribalLabour(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Tribal";
		self.description = """\
Everyone does their duty for the tribe... in theory."""
		
		self.productivity = 0.5;

class ForcedLabour(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Forced";
		self.description = """\
Everyone does their duty for the tribe... in theory."""
		
		self.productivity = 0.6;
		self.workerHappiness = 0.5;

class SerfdomLabour(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Forced";
		self.description = """\
Serfs are born into servitude to their master. In return, they are given land and limited\
personal freedom.""";
		
class EmancipatedLabour(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Emancipated";
		self.description = """\
""";

class EqualRightsLabour(Trait):
	def __init__(self):
		Trait.__init__(self);
		
		self.name = "Equal Rights";
		self.description = """\
""";


gTraits = DictToObject({
	'govt': DictToObject({
		'name': "Government",
		'values': DictToObject({
			'tribal': TribalGovt(),
			'military': MilitaryGovt(),
			'theocracy': TheocraticGovt(),
			'representative': RepresentativeGovt(),
			'democracy': DemocraticGovt()
		})
	}),
	'econ': DictToObject({
		'name': "Economy",
		'values': DictToObject({
			'barter': BarterEconomy(),
			'market': FreeMarketEconomy(),
			'centralized': CentralizedEconomy(),
			'state': StateOwnedEconomy(),
			'sealed': SealedEconomy()
		})
	}),
	'labour': DictToObject({
		'name': "Labour",
		'values': DictToObject({
			'tribal': TribalLabour()
		})
	})
});

